import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
    routes: [{
            path: '/',
            redirect: 'home'
        },
        {
            path: '/404',
            name: '404',
            component: resolve => require(['@/views/404.vue'], resolve),
            meta: {
                title: '排行榜', // 页面标题
                keepAlive: true, // 是否缓存页面
            }
        },
        {
            path: '/home',
            name: 'Home',
            component: resolve => require(['@/views/home/home.vue'], resolve),
            meta: {
                title: '首页', // 页面标题
                keepAlive: true, // 是否缓存页面
            }
        },
        {
            path: '/register',
            name: 'Register',
            component: resolve => require(['@/views/register/register.vue'], resolve),
            meta: {
                title: '用户授权', // 页面标题
                keepAlive: true, // 是否缓存页面
            }
        },
        {
            path: '/rule',
            name: 'Rule',
            component: resolve => require(['@/views/rule/rule.vue'], resolve),
            meta: {
                title: '规则', // 页面标题
                keepAlive: true, // 是否缓存页面
            }
        },
        {
            path: '/my',
            name: 'My',
            component: resolve => require(['@/views/my/my.vue'], resolve),
            meta: {
                title: '我的', // 页面标题
                keepAlive: true, // 是否缓存页面
            }
        },
        {
            path: '/ranking',
            name: 'Ranking',
            component: resolve => require(['@/views/ranking/ranking.vue'], resolve),
            meta: {
                title: '排行榜', // 页面标题
                keepAlive: true, // 是否缓存页面
            }
        }
    ]
})